export component PackageList inherits Window {
    in-out property <[PackageInfo]> all-packages;
    in-out property <PackageType> filter-type: PackageType.Linglong;

    // 过滤显示
    property <[PackageInfo]> filtered-packages <= {
        all-packages.filter(pkg => pkg.pkg_type == filter-type)
    };

    // 类型切换标签
    HorizontalLayout {
        Button {
            text: "玲珑包";
            clicked => { root.filter-type = PackageType.Linglong; }
        }
        Button {
            text: "Flatpak";
            clicked => { root.filter-type = PackageType.Flatpak; }
        }
        Button {
            text: "Snap";
            clicked => { root.filter-type = PackageType.Snap; }
        }
    }

    // 列表显示
    ListView {
        for pkg in filtered-packages: PackageItem {
            // 显示包信息及操作按钮
        }
    }
}